package myapps.ttclient.protocol.message.powerpoint;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;


public class PPTTCPSlideShowScreenCaptureMessage extends TTClientMessage
{
	public String temporaryKey = "";

	public byte[] data;

	public PPTTCPSlideShowScreenCaptureMessage(String temporaryKey, byte[] buffer)
	{
		this.temporaryKey = temporaryKey;
		this.data = buffer;
	}

	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{
		String key =  Helper.ParseAsString(dis);

		int length = dis.readInt();

		byte[] buffer = new byte[length];
		dis.readFully(buffer);

		return new PPTTCPSlideShowScreenCaptureMessage(key, buffer);
	}

	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException
	{
		throw new IOException("NotImplementedException");
	}
}
